<!-- src/views/ResetPassword.vue -->
<template>
    <div class="reset-password-container">
      <el-form ref="resetForm" :model="resetForm" label-width="100px">
        <el-form-item label="工号">
          <el-input v-model="resetForm.username" placeholder="请输入工号"></el-input>
        </el-form-item>
        <el-form-item label="手机号">
          <el-input v-model="resetForm.phone" placeholder="请输入绑定的手机号"></el-input>
        </el-form-item>
        <el-form-item>
          <el-button type="primary" @click="handleReset">重置密码</el-button>
        </el-form-item>
      </el-form>
    </div>
  </template>
  
  <script>
  export default {
    data() {
      return {
        resetForm: {
          username: '',
          phone: '',
        },
      };
    },
    methods: {
      handleReset() {
        // 这里可以添加重置密码的逻辑，比如发送请求到服务器验证用户名和手机号
        if (this.resetForm.username && this.resetForm.phone) {
        
          this.$message.success('密码重置成功！');
          this.$router.push('/login');  // 跳转到登录页面
        } else {
          this.$message.error('请输入完整的信息！');
        }
      },
    },
  };
  </script>
  
  <style scoped>
  .reset-password-container {
    width: 300px;
    margin: 100px auto;
  }
  </style>
  